implemented discrete sampling methods.