Added generate method