First working version
Clean up the output (and the code)