Oops, `ndo += 1` should have been in my code snippet as well.