I wonder if this checking is efficient. In most cases, we have no inactive elements or partly inactive elements (majority of elements are active). If all elements are active, this check are repeated until the last element.