Edited ver for qsmmp