Viewer: add sorting.