Updated kernel_main()