Got section formatting logic to work correctly