added function that write to the output html file