Improve performance and display of output.

Signed-off-by: Peter Chester <peter@tri.be>