iterative onestep gradient optimization