Adding ordering to queries.