cleaned up sorting, was a bit redundant