Major formatting fixes in output and in code.