applied WJD suggestions and minor mods