input output from mexwhamp works, debugging needed