remove while loop in q1p
remove while loop in q2p