sort and add