Updated code for NaiveKernel.c