added Matrix class