apr 22 version, added parfor, remember Tw_count update