Revised section logic, major bug resolved!
Unused code removal