for, while, doWhile versions all working properly.