add more operations. Switch to GADT for DimMat