added code snippets