Generate human readable code

Right now the generated code is impossible to read, not sure if it's something we want.
Also adding a small margin to the caption table.