added routing
added sophisticated routing