Added algorithm for pow.