Clean up

cleaned up some of the code, added exceptions to linear algebra header
and added comments to better describe programs