some code clean up, more logical weighting, more efficient combination generation