Implemented toString and equals on matrix