Moved the js code to a new file