The loop that was supposed to check the chain of previous or next siblings had a logic mistake where it would never traverse the chain, so we would get stuck looking at the immediate sibling forever.