Changed duplicate detection to be pointer based.