Support for List and Map

why not a standard imperative style for loop here, rather than replicating that with a while loop?