Matrix class completed