stddev improve and code clear