updated chapter02 code to pass jslint