Fixed incorrect calculation of best_disp