add write function and output file
clean up and add missing css