fixed incorrect calculation of the gaussian distribution