Add function to determine shard membership locally