Updated Apriori, ExtractClosed and extractMax to sort.