Made getSquare function