moved from loop to iter, added tests for tokens