Implement power function