Separated to include files, added matrix operations