added generate method