changed mean() to using std() instead