Adding class MDMatrix