Update matrices.cpp

Minor fixes and edits