add test function for the powerMethod