HW 7: added in-place partition