changes related to gicmo's comments i.e. checking string equality with
== instead of using compare, using it->id() rather than (*it).id().