add sections table, change affected queries, and bug fixes