Added helper code for apriori