use function next_second_dest_list to implement closest_to_half
cleaned code