Updated code to sort the results in ascending order.
Renamed date variables.