modified power to use an argument instead of a newly declared variable in the for loop