implemented power function