added threshold scan skeleton with fsm transitions