change quality variable to Q