Updated for latest version of QM