now saves and populates referenced_by classes. doesn't work if the referenced_by references one class