changed from Length(Q) /= 0 to Is_Not_Zero(Length(Q))