changed logic in SquareRoot