Add logic and test 2x2 matrix