Moved process closure into a function, process_world, that takes a world to operate on.