basic snippets function from thinkful