commit 2: use request animation frame to smoothen animation substantially