sorted diagram