add functions and license