updated to use all quality known so far