Added loop to compare with every element.