preliminary code snippets