Incorporated the concept of resiliency as well as Jaume and Boris's suggestions