Sorting using statements