modified drawSquare()