removed a lot of sorting