insert and format comments.
fix multi-threading.