matrix way being added to solve correctly