improve html output, add some debugging