Sorting parts before returning them