implemented new method of sampling to reduce error