tried to add a function

Thought about making the program run continuously. Tried to add a
function to surround the whole program.
I am going to add a loop function inside