updated loop
updated loop