Finished solve method and added ways to deal with problematic entries
(zeroes, linearly dependent rows)