Added more documentation to js file