added some code snippets