create_snippet function
commented functions in index