finished optimization of exp diff