Modified some code and added several comments wherever I saw the // BOZO comment. Still one section left to tackle, which is the render section.