cleaned up .js to make jslint happier