sort and process inters after intras