Added a generic iterate function that is used in generating the future pod states. It is like a fold, but generates a list from a starting value, rather than reducing a list.