changed fpoptimize.py