adding Dijkstras's algorithm