simplify some of the loops

switched the candidate key check to use a set, and the tabTable
function to use a range over a channel instead of a loop with a break