created validateSubtree function, added more types