Remove duplication and random input