This is all of the main code for the mod