allow to order by distance

this has not really something to do with the pull request (it tests the "where clause"). just saw it was not "swapped" as the test indicated (compare with the test above this one).