C++11 Version
Final for WFM
wfm and scn working