addint some debug code to generate sampling