added more generation code