Added stdev preprocessor and random sample generation