Added data capture for quality variable with conditionals to check for value.