updated script
updated for loop
resolve conflict