reorganize some of the poisson sampling code