cleverer redrawing, added markdown