Moved the code from index.html

Moved the code from index.html and also added use script on all files.