added 'closest' functionality to router decision logic