began separating out modes into simple FSM, more optimization tweaks.