improve addPositionToPath