Defined modes for the program

Modes instead of lists of functions. The functions are within the modes.