cleaned up a bit; fixed a redraw bug