trying to write continious and discrete re-samples