Added comments for code/correct jslint warnings/added some styles