Added an example file, fully commented the JS file