the basic FSM

also some problems, we need a big discuss tomorrow！