sorting

mostly done