made a lot of changes, added a linear system solver