Define mod

This is the final working tweak !