improved comments, removed unused not group by case for the statistics