worked on generator function. Very inelegant
forall test passing