updated test code, always initialize quality array to a new list