Added basic adaptive sampling.