implemented a leaf processor