base version for sampling