cleanup and bug fix
mexwhamp.F compiles on mac! but later crashes in matlab