added forloop that has a conditional for newline