added jshint globals
refactored formatOutput