write only when output is concatenated

+ use enumerate