fixed incorrect length check, now actual children count not length of parent
restructured ex3