Implemented raiseToPower methd