catch broken pipe
reformulated the MH code
don't run makedirs
 simplified plotting