modified PredictPath function, made it fit the queue