fixes routing algo