added javascript snippets