calculate power without math.pow