unfortunately breaks previous, but I should have done this from start
also extracts out gaussian_kernel func