added some documentation to the JS file