add count-leaves-machine