Changes format of program to be more accommodating for button-activated
loops