changed forloop