add sections and clean up code