Calcuating the mean and standard deviation for normalize

Note theres more info and sample code here