finalizing pil script