added nwf function