An improved adaptive routing algorithm