Moar matrix code & test cases