Support for 10 sections

Also I changed the code that handles sections, so that
potentially you can add support for any number of sections.