IPMod function added