Added comparators for the restructure function