Modified run script to take threshold parameter