ruined matrix class
Revert "ruined matrix class"

This reverts commit cc66d6862c2cede989b7202abf166e778169aebe.