modified js snippets