update to work on generators