kaplanWald implemented; minor fixes