code for snippets