fixed argument order mistake and added exponentiation