added repaint to main loop