find relations between flags and length