please use ```CGaussianKernel* kernel``` here and avoid the casting one line below.