first version of max apriori