converted from module to script