Mod function updates - better documentation