removed duplicates, improved search