added power function implementation and tests