only calculate the failure array once