Fixed a UI bug, made the renderNextBlock code much simpler to understand and more modular