a flags parameter for a little bit of basic state management on each state (needed for my update to the T_CUEREAD state)