Updated js snippets