x is columns and y is rows
Merge pull request #14 from mharrys/matrix-fix

Seems to be working as intended when I did some small test.