some more really basic state machine logic