minor amendments and cleaning up