this works for 2x2 matrix types now to figure out NxN square types.