update bar graph code