modified dscript library functions