Added function that returns all valid squares.