Modified script file to match Prabhu's requirement