Some globals and functions