add m.wtd.hist.R, solve some x not counted problem