Added a pie chart function