work on changing editor to state machine