Now uses hashtables to map names to RankedNames; fixed some errors
fixed some more errors