basic scheduler + state machines