issue #77 and formatting cleanup