Now closing various tags as necessary. Also can add newlines for text output.