refactor to generate all candidates first, parse them, and then do scoring (pair programming with @liucan)