modified computeRout method, it works now