fixed bug in the power of N