Sampling functions added but untested