working federated version