how do I use the result of the last step of a for loop in the next iteration? - Windmill