basically workiing function, needs to do tie breaking correctly. Also needs to handle non happy-path values for 'num'.
Now sorting by rank and name to handle ties correctly.
now implemented num = 'best'