refactored shipSections function