use generator_len - simplify