getSquareIntoMatrix function added