For each needs testing
Added the stmts at the specific point in the state
Updated stmts to keep current stmts in state
Updated flow environment with the new state
Fixed mistake in state arguments