moved function into the html