work on state machine

work on scanning across pages