Implement pow function.