Making the pathGesture alforithm work again