Added isPerfectSquare