Small change to assignSections logic