snippets of useful code for later