worked and reworked functions and html