adding loop for word comparison