Fixed while loop. at end of loop it jumped to after the condition loop, so it was always looping.