End of chapter 12 - added duplicate items checking and tests.