Fix issue #45: add support for ordering one way or the other.