Remove the redundant loop variable k from the kernel.