Added .endIteration() and tested .when() and .otherwise()