completed function of sending history samples,but not yet test it.