tired sorting
impelemented array for list of trees