11.c: refine format, add comments and cleanup