adding second version of snippets program with added functions