define number of samples as NSAMPLES