functional, has duplicates still