i can see no previous appearance of `total_instances` in this function: is that okay?