Added redrawing function.