switch to requestAnimFrame for updating