compiles and fsm