ran through jslint and fixed up some things, still some errors