update ffoct.py, add restart ability (for ipython)