Added some pretty printing and fixed csv output