Implemented dijstra's algorithm. Haven't tested it yet.