added sort_by date, added group_by day functionality