added: numSamples check