For merge
Added state machines.