added looping to compare