Removed all the global variables (yuck)! The output is still garbled, need to fix clock time updating.