'main' is supposed to guide the program, and there should be only one function named 'main'. You can use threading. Basically, threads will kind of execute simultaneously doing something on their own. Check that out on the Internet.