Ran main.js through jshint and corrected errors