modified miflow.f90 for output