Made code portable between matrix sizes.
Added definitions of pin numbers to functions.
Switch "x" and "y" --> x is for row position, y for height in matrix.