add generate method