Changes for best fit logic