Added inplace sort