added forloop logic