worked on weighted pathfinding algorithm