modified kernel.c