Modified code to no longer use the top field on trees