added std dev option to data generation function