Added a gen_fsm template