parseTree function complete
sort function complete. versions have now it's issues as childs