Added animation frame to main.js
modified animation frame to follow High-quality code