added the code which displays all the leaf nodes