change Matrix class