updated the code for new kernels