Improve progress bar.
Fix apriori calculation.
Encapsulated apriori calculation.