Updated code documentation and fixed a couple redraw bugs