remove an unnecessary for loop