Wrote serial version of Dijkstra