implementation of a DenseMatrix for my Data Structures Class