Updated setSquare method