added comments into JS code