I need a new sub function to generate the htmlfile