           expression.append(number_with_this_val)
 
       invoke: (expression)->
-        _FinalOpenSubExpressionApplcation.build((expr)=> @onFinalExpression(expr)).
-          invokeOrDefault(expression)
+        _FinalOpenSubExpressionApplication.build(expression).
+          invokeOrDefault((expr)=> @onFinalExpression(expr))
 
     class_mixer(AppendNumber)
 
     class ExponentiateLast
       initialize: (@opts={})->
+
+      baseExpression: (base)->
+        comps.expression.build(expression: [base])
+
+      powerExpression: ()->
+        power = if @opts.power
+          comps.expression.build expression: [
+            comps.number.build(value: @opts.power)
+          ]
+        else
+          comps.expression.build expression: []
+
+        if @opts.power_closed
+          power
+        else
+          power.open()
+
       invoke: (expression)->
         last = expression.last()
 
         # in the first case, our base case comes
         # from the contents of a previous part of the expression
         if it = last.preceedingSubexpression()
-          base = it
+          base = @baseExpression(it)
 
         # if the previous element is an operator but has no sub-expression,
         # then we are dropping the operator and use the number prior to the operator
         else if last.isOperator()
           expression = expression.withoutLast() #remove useless operator
-          base = expression.last()
+          base = @baseExpression(expression.last())
 
         # otherwise, our base is just the number before
         else
-          base = expression.last()
-
-        power = if @opts.power then comps.number.build(value: @opts.power) else comps.blank.build()
+          base = @baseExpression(expression.last())
+
+
+        power = @powerExpression()
+
+
 
         expression.replaceLast(
           comps.exponentiation.build(base: base, power: power))
 
     class_mixer(ExponentiateLast)
+
+    class SquareLast
 
 
     class AppendMultiplication

      append_addition: AppendAddition
      append_subtraction: AppendSubtraction
      negate_last: Negation
      open_sub_expression: OpenSub
      close_sub_expression: CloseSub
      append_division: AppendDivision
      pi: Pi
      square_root: SquareRoot

    return exports

        else # not closable, not handled, return
          expr

      invoke: (@action)->
        @findAndPerformAction(@expr)

      wasFound: -> @found

      updateWithNewSubexp: (expr, subexp)->
