Rewrote Djikstra's and wrote lame tests for it