write comments and refine a macro