Text this: A matrix-based damage assessment and recovery algorithm