updating JS with a few notes & hopefully no bugs.