sorting in parent proc implemented