editted for loop