started to implement sorting a Tree