Implemented algorithm and test for matrices of form 1x1 and 2x2.