implemented multiple levels within Matrix class