countLeaves and cleanup