switched from setInterval to requestAnimation