Typecasting NumberOfSamples to int.