some changes to script for ease