The first parts of the mod code