hopefully added code that will deal with programs that infinite loop, now to test