cleaned up kernel writer a bit. still refactoring. identified issue in variable declarations in kernel writer