clean up -inf, execute script for path lengths