added notes to the javascript