added remaining function snippets