basic sorting in place