native code works now with basinhopping, function calls wrong