created extract_raw_data function