modified to add overlay hops counter