extracted fillSquareArray as a separate method
now can process any rectangular array
now the array is allocated dynamically