@lbud: The use of global variables is usually frowned upon, is there a good reason for using it here?