Extract leaves from tree into DLL

Signed-off-by: Vidhoon Viswanathan <vidhu2366@gmail.com>