Included avgDifSample and uncertain functions