Changed redefintion to find the best case rather than the first