Improved result folding
Formatting changes