basic matrix support without differentiation