added wfsm.cpp