Add matrix element class