basic state machine structure in place