tidying up sort stuff