Consolidated some of the steps.
Found the start and end of loop and the continue calls
Reduction of cases and merging
Consolidating more steps
Further coalescing of steps
More states identified
More merging of steps
Coalesced more steps.
More merging of steps