Implemented Dijsktra's Algorithm