could you use an STL iterator here instead