annotate_and_write method