Worked out some logic for sorting hints