organized, created process_data function