is doing what it's supposed to besides the infinite while loop