Add notes and minor changes to js.

changed some variable names and some other thoughts.