Refactor matrix code to be COLUMN MAJOR