modify shortest path to real data (not finished yet)