scala snippets