adding mmat function and license