tidied up a bit of useless dijkstra's code