Added a break to the nested loop after the candidate was chosen, without it every candidate would get chosen regardless.