add redrawing + class abstraction