Probably worth drawing little before and after ASCII-art trees here to illustrate what's being checked.