Changed Matrix class