Starting to implement Dijkstra's algorithm in C