new version of matprod, with less chance of name conflicts