add quality input for function