changed decode to iterator