final version of tree componenet