minor cleanup
use reqAnimFrame in demo for better responsiveness