Update  before changes, changing while into for