Ordinal collapsing function