updated extract_csv.py