matrix class added