update and paint methods in AnimationFrame