changed sum to sum_entries