add gen method