Fix syntax and add js snippets