Added weight in order to order the tree.