updated gaussian_kernel function