added speed improvement when computing Gaussian kernel + improved sigma2 estimation + comments