Cleaned up and performance tuned output.