modified the algorithm for the combo count.