bug fix and fortran convert