Movement and dijkstra optimizations.