Updated to explain why all the functions are global.