Add code to prevent matching same items twice