implemented recursive routing