fixed variable time so it counts from 10 to 0
Conflicts fixed in main.js
Removed duplicated code