changed returns back into yields & modified unit-test.py accordingly to handle yields