Script to patch the output of the first ranker
Forgot to add sorting before writing.