updated example and moved the JS to the plugin JS file