generate method