Moved JS from index page into separate file