The functions file

All functions are defined here.