your while run at once. Did you want to move 'return 0' to outside cycle?