rewrite select_car function