Added support for ordering (thanks @klum314)