added documentation to the js file