some sorting
first draft of new structure