added design code for maintaining execution state.