further sort logic