updated routing code