generateSquare method only creating size x 1 rectangles, bug needs to be fixed