     @updateCurrentExpressionWithCommand cmd
 
   exponentClick: ->
+    if @exponentLastPressed
+      return
+    @exponentLastPressed = true
     @updateCurrentExpressionWithCommand @math.commands.build_exponentiate_last()
 
   negativeClick: ->
+    @exponentLastPressed = false
     @updateCurrentExpressionWithCommand @math.commands.build_negate_last()
 
   additionClick: ->
+    @exponentLastPressed = false
     @updateCurrentExpressionWithCommand @math.commands.build_append_addition()
 
   multiplicationClick: ->
     @updateCurrentExpressionWithCommand @math.commands.build_append_multiplication()
 
   divisionClick: ->
+    @exponentLastPressed = false
     @updateCurrentExpressionWithCommand @math.commands.build_append_division()
 
   subtractionClick: ->
+    @exponentLastPressed = false
     @updateCurrentExpressionWithCommand @math.commands.build_append_subtraction()
 
   decimalClick: ->
+    @exponentLastPressed = false
     if @reset_on_next_number
       @reset_on_next_number = false
       @updateCurrentExpressionWithCommand @math.commands.build_reset()


  # command actions
  clearClick: ->
    @updateCurrentExpressionWithCommand @math.commands.build_reset()

  equalsClick: ->
    @updateCurrentExpressionWithCommand @math.commands.build_calculate()
    @reset_on_next_number = true

  squareClick: ->
    @updateCurrentExpressionWithCommand @math.commands.build_square()
    @reset_on_next_number = true

  squareRootClick: ->
    @updateCurrentExpressionWithCommand @math.commands.build_square_root()
    @reset_on_next_number = true

  lparenClick: ->
    @updateCurrentExpressionWithCommand @math.commands.build_append_sub_expression()

  rparenClick: ->
    @updateCurrentExpressionWithCommand @math.commands.build_exit_sub_expression()

  piClick: ->
    @updateCurrentExpressionWithCommand @math.commands.build_append_pi()

class_mixer(Calculator)

    @view = CalculatorView.build(@, @element, @math, @buttonsToRender)
    @expression_position = historic_value.build()
    @updateCurrentExpressionWithCommand @math.commands.build_reset()
    @exponentLastPressed = false

  displayValue: ->
    exp_pos = @expression_position.current()
