add printing the kernel to a file