ported PotExt fortran method; added fortran code for helping