modified to more jshint compliant app