Put everything into functions!
Put everything into functions!

Still need to clean up entire code, much usage of global variables. Also
messed with the main loop logic, thinking it was messed up. Was it?

rliou92/umonitor,rliou92/umonitor