sample code snippets