Define some functions and structures.