improve sorting