add my second algorithm for routes searching