simplified kernel code