changed iterator type to nonconst (compile errors)