merged in lastest code; made two versions of script for different Pilot versions
removed original file