modified graph path finding functions to take in a vector by reference to fill up the path