finished dij algo