actually sort results when requested, fixes #5