Added multi-hop logic