added p tags around buffer printing. However this creates rather obnoxious line spacing. so there must be a better way of using the formatting state to determine to print the p tags