CS 240: updated 14.3.2 with a clearer algorithm for the failure array.