Changed the output to JSON formatting. Not the best ever format, but simpler than trying to rpoduce textual formats.