added -debug to save md data, default tempdir to directory where sim file is