slight changes to envelopegenerator.... I will commit the other changes later