Better working pig script.