Matrix class updated