bugfix. .gen method was missing although the functionality was implemented. also added tests for it