allow reverse sorting and properly order numbers

Allows sorting in both directions