Updated path following code