added a setup_iterator function to iter tokens