added iterable support from @niclabs 's pull request