added FSM. need to update tree.