modified script to use function from module