new routing algorithm working well, fixed #1