basic state machine in there. is this what you had in mind?