added c code snippets