The previous implementation was overly complicated and may have been buggy except when searching only 2 plies ahead.