added ascending option to sorting

Only the sorting in descending order was implemented.

Added the ascending way as well.

ps: my first pull request ever...