Adding code for kernelization