added shell code for Kernel scalar promotion optimization and future bug fix