changed TreeGender type to SubTreeType