Minor code cleanup
Added correct dates and implemented sorting.