choose the best solution