sample with range argument to be safe