Tweaked JS.

Removed junk code and Linted.