moved data array creation to a separate function
Fixed the bug relating to enabling and disabling sections

Removed most  of the debug messages