Removed debugging statements and fixed interation between noteQ and
uniqueQ variables.