parse_data now produces csv file in correct format