updated script and tests