std deviation calculation fix