expanded version with polyline