simplePieChart function revised