added to piechart logic