Removed redundancy in code where running the machine. Identified final state at the end of the machine run. Cleanup and final touches remain to be done.