extract_data.py now extracts the data into the required form