Added an option to revert the sort order.