Fixed the logic of kernel and got rid of script.js file

Signed-off-by: shrimpboyho <shrimpboyhoftw@gmail.com>