Remove ducplicated white space removal and added JSON output.