matrix solver with comments