added summarize_data function