Add two global variables and the data structure changes to support them.