Better apriori implementation