Add addValidID method; remove m_sortedIds
Change m_validIds.push_back call to addValidID