Putting together optimization framework with test functions