No longer able to get stuck in an infinite while loop