redo the routing, improved scope assigning