major changes in matrix representation + indexing