various code snippets that might be useful later