tidied sort