Added hierarchy to Contours