added exponentiation (method 1)