added some sorting to qMs