 	lang: 'enUS'
 	type: 'number'
 
-userOptions = Object.assign({}, defaultOptions)
-
 setOptions = (options) ->
-	Object.assign(userOptions, options)
-	return userOptions
+	Object.assign(@options, options)
+	return @options
 
 resetOptions = () ->
-	userOptions = Object.assign({}, defaultOptions)
-	return userOptions
+	@options = Object.assign({}, defaultOptions)
+	return @options
 
 ###
 Convert numerical input to a specific language.

Numbo::zhCN = zhCN

Numbo::getDefaultOptions = () -> return defaultOptions
Numbo::getOptions = () -> return userOptions
Numbo::setOptions = setOptions
Numbo::resetOptions = resetOptions




class Numbo
	constructor: (options) ->
		if !options? # options == null
			@options = defaultOptions
		else
			@options = Object.assign({}, defaultOptions, options)

# Public methods
Numbo::convert = convert
