mm loop changes. added wild card condition