Function returned x.sort which does sort x but does not return the array. x itself has to be returned after sorting.