using iterator to redo the vector related exercise