Added a useful joinSections function.