finetuned extract.py script