Moved javascript into .js files. Commented javascript code