added possibility to sort the entries
added percentages and legend to the pie chart
added some comments
merged create_stats into master