added some more sorting stuff