ran js through jslint, corrected 100+ errors and style issues