get sorted structure