changing to use a dict instead of a queue on routers.