JS code moved from index.html to a separate file