reformatted and cleaned up JSHint warnings