Refactoring

added array_unique to delete duplicate values