changed the termination conditions so that it only ends in qpspecial