removed a few bugs from routing algorith. the simulation is made more deterministics as well, i.e. to make debuging easer.