Added the path finding algorithm as a parameter.