first pass at sorting