https://edstem.org/us/courses/62208/discussion/5390390 In Algorithm 2, the 3rd line is assigning K, not H.