replicas should be a size_t also
nbuckets is a size_t