first pass at resilience code