code snippets that I have found useful