updated and modified snippets