adding print statements within loop