Implemented output to file and added doctype.