changed assignRanks to zipWithIndex
changed assignUniqueIds to zipWithUniqueId
minor updates