added functionality of pkgtree

This is a function for PKGTREE