fixed switch to while c didn't find the error, lol