Updated approach to include contours.