translating something like 2000 lines of FORTRAN to JavaScript