code for frequent itemset collection [ci skip]