Finished in code https://github.com/AndyQu/sicp_exercise/blob/master/src/main/scala/sicp/Exponentiation.scala