removed unnecessary loop