Reimplemented own pow

optimisation