Add function to sort the fused rings