working on filtering duplicate elements