updated pig script