implement Apriori algorithm