Implemented: steps 6 and 7, transitions generated
Needs verification
Refactoring done