fix bug, candidates lost order after sort. but, seems very slow.