snippets of code that might be useful