commented sampling.py