Add new function to PathFinding class