reads dmatrix  TODO: store in a map structure/ vector vector