fixed class Square
A more elegent implementation using 2D arrays