removing duplicates from tm and mt combined