Got the script working