Slightly refined centerline algorithm