separate HTML and JS file, adding summary function