Added change to solve matrix