Updated scripts to be more flexible.