Bag extraction script.