adding original fortran code