added example code for kernel, fixed the template module list generation