Update matrices.cpp