Do some work on sorting and buttons.