preserve context and allow argument passing to generator body
added some test cases