Explanation of the head-corner algorithm.