added basic route determination algorithm