       controlKeys.indexOf(which) >= 0
 
     invalidInput = (elem, event, options) ->
-      invalidKey(event) or invalidZero(elem, event) or maxDigitsReached(elem, options)
+      invalidKey(event) or invalidZero(elem, event)
 
     # invalid actions
     invalidKey = (event) ->

                # elem.val val.replace /,/g, '' # ATTN: LINE THAT ADDS ON-CLICK COMMA REMOVAL
                elem[0].select()

            elem.on 'keydown', (event)->
              keycode = event.which

              return if invalidInput(elem, event, options) 

              if keycode == 8 # backspace is pressed
                event.preventDefault()
                event.stopPropagation()
                backspacePressed(elem, event) # handle logic for backspace
              else if keycode == 46 # backspace is pressed
                event.preventDefault()
                event.stopPropagation()
                deletePressed(elem, event) # handle logic for backspace

              if elem.val().length == 4 || elem.val().length == 8 # a new comma is added
                newCursorPosition = elem[0].selectionStart + 1
              else if elem[0].selectionStart < elem.val().length # cursor is adding numbers, but is not at the end of the input field
                newCursorPosition = elem[0].selectionStart
              else # cursor is adding numbers at the end of the input field
                newCursorPosition = elem[0].selectionStart + 1

              elem.val resetCommas(elem.val()) # reformat the number in place
              elem[0].setSelectionRange(newCursorPosition, newCursorPosition) # set the new cursor position

            if options.preventInvalidInput == true
              elem.on 'keypress', (event) ->
                event.preventDefault()
                event.stopPropagation()

                return if invalidInput(elem, event, options)

                keycode = event.which

                if keycode >= 48 and keycode <= 57 # insert number character
                  insertCharacter(elem, event)

                else
                  if elem.val().length == 4 || elem.val().length == 8 # a new comma is added
                    newCursorPosition = elem[0].selectionStart + 1
                  else if elem[0].selectionStart < elem.val().length # cursor is adding numbers, but is not at the end of the input field
                    newCursorPosition = elem[0].selectionStart
                  else # cursor is adding numbers at the end of the input field
                    newCursorPosition = elem[0].selectionStart + 1

                elem.val resetCommas(elem.val()) # reformat the number in place
                elem[0].setSelectionRange(newCursorPosition, newCursorPosition) # set the new cursor position

    }
]

    makeMaxDigits = (maxDigits) ->
        validRegex = new RegExp "^-?\\d{0,#{maxDigits}}(\\.\\d*)?$"
        (val) -> validRegex.test val

    killEvent = (event) ->
      event.preventDefault()
      event.stopPropagation()

    findNewCursorPosition = (elem) ->
      if elem.val().length == 4 || elem.val().length == 8 # a new comma is added
        elem[0].selectionStart + 1
      else if elem[0].selectionStart < elem.val().length # cursor is adding numbers, but is not at the end of the input field
        elem[0].selectionStart
      else # cursor is adding numbers at the end of the input field
        elem[0].selectionStart + 1

    backspaceAtComma = (elem, event) ->
      cursorPos = elem[0].selectionStart
