update example to in place sort