mod and basic math