fixed bug that did not give solutions if rectangle matrix