Passing arguments to generator function