update the implementaion of dijkstak algorithm