two hop algorithm