Moved custom functions around.