         if currentRow + 1 < @codePrefixLength or currentRow + 1 >= maxRow - (@codeSuffixLength - 1)
             return
 
+        @commands[command]['usesRemaining']--
         printLine = (@createBlankFunctionHeader command) + ';'
         text.insertLines currentRow + 1, [printLine]
 

    ###
        Creates and provides functionality for an Ace editor representing player's code.
    ###
    constructor: (@editorDivId, @commands, codeText, @wrapCode, @codePrefix, @codeSuffix, @freeEdit) ->
        ###
            Sets internal variables, the default text and buttons
            and their event handlers.

        @editor.on 'changeSelection', callback
        return

    switchUp: ({currentRow, currentColumn}) ->
        maxRow = @editSession.getLength()
        if currentRow - 1 < @codePrefixLength or currentRow >= maxRow - @codeSuffixLength
