added exponentiation before sum