fixed a few issues with kernelC; added examples with main functions