added animation loop to demo 3