new change to not use Math.Pow()