I see. Still dont understand this if

if (bundles != null && bundles != this.bundles) {

What does the bundles being passed to this method not being null have to do with this loop. We want to delete these bundles as long as they are not already deleted if i understand it correctly.