Reduce method that returns unique values assigned to key