Add row and column duplicate detection and resolution functions