repairing some coding and style modifications