cleaned up animation demo main loop