Rewrote the kernel invocation function in a different way while commenting out original code