added routing function & structure