Update matrices.cpp

Made large changes ^_^