Added more efficient way to find the item in the loop.