working on in-place sort