added code documentation in js file