use event loop instead of brute-force rendering