DO and WHILE loops working by themselves