Added first version of main algorithm to case analyzer.