added notes to js functions