Added tail-recursive "power(n,k)" function instead of the weird "twoExp" function