Sort by Date

Backup of sort by date code since I'm removing it.