initial version of MakeQFromS()